package com.bysj.dao.impl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.bysj.dao.SuperDao;
import com.bysj.entity.Super;
import com.bysj.util.Dbutils;

public class SuperDaoImpl implements SuperDao {
	private Dbutils db=new Dbutils();
	@Override
	public boolean isEnter(String sql,Super s) {
		Connection conn=db.getConnection();
		PreparedStatement pst=null;
		boolean b=false;
		try {
			pst=conn.prepareStatement(sql);
			pst.setString(1, s.getName());
			pst.setString(2, s.getPasswd());
			if(pst.executeQuery().next()){
				b=true;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally{
			db.closeAll(null, pst, conn);
		}
		return b;
	}

}
